package com.alex.wechat.mp.message.news.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.jeecgframework.core.common.entity.IdEntity;

/**
 * 图文消息模板。
 * 
 * @author Debenson
 * @since 0.1
 */
@Entity
@Table(name = "wx_newstemplate")
public class WxNewsTemplate extends IdEntity {
  private static final long serialVersionUID = -2386838166034753189L;

  private String templateName;
  private List<WxNewsItem> newsItemList;
  private String accountId;
  private String mediaId;
  /** 创建日期 */
  private java.util.Date createDate;
  /** 更新日期 */
  private java.util.Date updateDate;

  @Column(name = "accountid", length = 100)
  public String getAccountId() {
    return accountId;
  }

  public void setAccountId(String accountId) {
    this.accountId = accountId;
  }

  @Column(name = "tempatename")
  public String getTemplateName() {
    return templateName;
  }

  public void setTemplateName(String templateName) {
    this.templateName = templateName;
  }

  /**
   * 方法: 取得更新日期
   * 
   * @return 更新日期
   */
  @Column(name = "UPDATE_DATE", nullable = true, length = 20)
  public java.util.Date getUpdateDate() {
    return this.updateDate;
  }

  /**
   * 方法: 设置更新日期
   *
   * @param updateDate
   *          更新日期
   */
  public void setUpdateDate(java.util.Date updateDate) {
    this.updateDate = updateDate;
  }

  /**
   * 方法: 取得创建日期
   * 
   * @return 创建日期
   */
  @Column(name = "CREATE_DATE", nullable = true, length = 20)
  public java.util.Date getCreateDate() {
    return this.createDate;
  }

  /**
   * 方法: 设置创建日期
   *
   * @param createDate
   *          创建日期
   */
  public void setCreateDate(java.util.Date createDate) {
    this.createDate = createDate;
  }

  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  @JoinColumn(name = "templateid")
  @OrderBy("orders")
  public List<WxNewsItem> getNewsItemList() {
    return newsItemList;
  }

  public void setNewsItemList(List<WxNewsItem> newsItemList) {
    this.newsItemList = newsItemList;
  }

  /** 微信媒体标识 */
  @Column(name = "MEDIA_ID", nullable = true, length = 50)
  public String getMediaId() {
    return mediaId;
  }

  public void setMediaId(String mediaId) {
    this.mediaId = mediaId;
  }

}
